from django.db import models

# Create your models here.
class ActionInfo(models.Model):
    date_time = models.DateTimeField()
    user = models.CharField(max_length=255)
    action = models.CharField(max_length=255, null=True)
    code = models.CharField(max_length=255)
    info = models.TextField(null=True)
    
    def __str__(self):
        if self.info:
            return '%s %s %s %s %s' % (self.date_time, self.user, 
                                   self.action, self.code, self.info)
        else:
            return '%s %s %s %s' % (self.date_time, self.user, 
                                   self.action, self.code)
            
            

class FileInfo(models.Model):
    date_time = models.DateTimeField()
    user = models.CharField(max_length=255)
    file_size = models.IntegerField()
    file_count = models.IntegerField()
    
    def __str__(self):
        return '%s %s %s %s' % (self.date_time, self.user, 
                                self.file_size, self.file_count)
    